package com.zhl.study.controller;

import com.zhl.study.base.ResponseFactory;
import com.zhl.study.base.Result;
import com.zhl.study.service.TestRetryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description TODO
 * @Author: z156940l@outlook.com
 * @className PayController
 * @Date: 2023/4/26 16:45
 */
@RestController
@RequestMapping("api/")
@Api(value = "springRetry实现循环重试", tags = "springRetry实现循环重试")
public class PayController {


    @Autowired
    TestRetryService testRetryService;

    @GetMapping("/addCode/{code}")
    @ApiOperation(httpMethod = "GET", value = "code=0体现")
    public Result<String> addCode(@PathVariable int code) throws Exception {
        return ResponseFactory.ok(testRetryService.test(code));
    }


}